<?php
session_start();
require 'crud/CustomSecurity.class.php';
require 'common/Utility.php';
require 'crud/Userdata.class.php';
require 'crud/Countries.class.php';
require 'crud/Players.class.php';
require 'db/configuration.php';
loginCheck();
loadDB();
if (isset($_POST['newvalue'])){
	$crud = new Userdata(con());
	$countries = new Countries(con());
	$line = $crud->get();
	$champ0 = $countries->getCountry($_POST['newvalue']);
	$champ = $champ0[0][0];
	if (count($line) == 0){
		$crud->add($champ, $champ);
		echo $champ;
	} else {
		$crud->update($champ, $champ);
		echo $champ;
	}
}
?>